<layout name="page" />
<block name="content">
{:widget('page_header/simple',array('name'=>'新建日历事项'))}
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
	<input type="hidden" id="ajax" name="ajax" value="0">	
	<input type="hidden" id="opmode" name="opmode" value="add">
	<input type="hidden" name="actor" id="actor">
	
		<label class="input-label" for="name">标题*：</label>
		
			<input class="input" type="text" id="name" name="name" check="required" info="请输入标题">
		</div>
	</div>

	
		<label class="input-label" for="name">开始时间*：</label>
		
			<input type="text" id="start_time" name="start_time" readonly="readonly" class="input input-date-time" check="required" info="请输入开始日期">			
		</div>
	</div>

	
		<label class="input-label" for="name">结束时间*：</label>
		
			<input type="text" id="end_time" name="end_time" readonly="readonly"
			class="input input-date-time" check="required" info="请输入结束日期">			
		</div>
	</div>

	
		<label class="input-label" for="location">地点：</label>
		
			<input class="input" type="text" id="location" name="location">
		</div>
	</div>

	
		<label class="input-label" for="location">优先级：</label>
		
			<div class="input-static" >
				<input type="hidden" id="priority" name="priority"/>
				<div  class="slider_box" >
					<div class="left" >
						低
					</div>
					<div id="slider-range-priority"></div>
					<div class="right" >
						高
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class=""></div>
	
		<label class="input-label" for="location">参与人员：</label>
		
			<div id="actor_wrap" class="inputbox">
				<a class="pull-right btn btn-link text-center" onclick="popup_actor();"><i class="fa fa-user"></i> </a>
				<div class="wrap" >
					<span class="address_list"></span>
					<span class="text" >
						<input class="letter" type="text"  >
					</span>
				</div>
				<div class="search dropdown ">
					<ul class="dropdown-menu"></ul>
				</div>
			</div>
		</div>
	</div>

	
		<label class="input-label" >附件：</label>
		
			{:widget('file_upload/add')}
		</div>
	</div>
	
		<div class="col-xs-12">
			<textarea  class="editor" id="content" name="content" style="width:100%;height:300px;"></textarea>
		</div>
	</div>

	<div class="action">
		<a class="btn btn-normal" onclick="save()">保存</a>
		<a  class="btn btn-return" onclick="go_return_url();">取消</a>
	</div>
</form></block>
<block name="js">
<script type="text/javascript">
	function popup_actor() {
		winopen("{:url('popup/actor')}",560, 470);
	}

	function save() {
		$("#actor").val("");
		$("#actor_wrap span.address_list span").each(function() {
			$("#actor").val($("#actor").val() + $(this).find("b").text() + '|' + $(this).attr("data") + ";");
		});
		 send_form("form_data", "{:url('save')}");
	}

	$(document).ready(function() {
		$(document).on("click", ".inputbox .address_list a.del", function() {
			$(this).parent().parent().remove();
		});
		fill_time("start_time");
		fill_time("end_time");

		$("#priority").val(3);
		$("#slider-range-priority").slider({
			range : "min",
			min : 1,
			max : 5,
			value : 3,
			slide : function(event, ui) {
				$("#priority").val(ui.value);
				$("div.slider_box div.ui-slider").css("background-color", schedule_bg(ui.value));
				$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(ui.value));
			}
		});
		$("div.slider_box div.ui-slider").css("background-color", schedule_bg(3));
		$("div.slider_box div.ui-widget-header").css("background-color", schedule_bg(3));
	}); 
</script>
</block>